AR = ar
LEX = flex
CXX = g++
CXXFLAGS = -g `sdl-config --cflags`
LDFLAGS = `sdl-config --libs` -lSDL_image -lSDL_ttf -lfl -lSDL_mixer
TARGET = libgame.a 
MISCFILES = makefile 
OBJS = game.o sprite.o layer.o tilelayer.o textsprite.o conffile.o gamestate.o image.o spritegroup.o tmusic.o tsound.o mixer.o bezier4.o bezier3.o
DOCDIR=doc

all:  $(TARGET) 

dox: 
	doxygen doxyfile

dox-clean:
	rm -rf $(DOCDIR)/*

clean: dox-clean
	rm -rf *.o core $(TARGET) conffile.cpp 

dist:
	tar cvzf $(DISTFILE).tgz *.cc *.h 

$(TARGET): $(OBJS)
	$(AR) -rs $(TARGET) *.o 

conffile.cpp: conffile.lex
	$(LEX) -+ -oconffile.cpp conffile.lex
	

.SUFIXES: .cpp 
.cpp.o:
	$(CXX) -c $(CXXFLAGS) -o $@ $<
